<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>

<body>
<div class="row">
    <div class="col-md-12">
        <form class="form-horizontal" action="${ctx}/dictionary/insert" method="post" id="editForm1">
             <input type="hidden" name="id" id="id" value="${dictionary.id}"/>
            <input type="hidden" name="createDate" id="createDate" value="${dictionary.createDate}"/>
            <div class="form-group">
                <label class="col-md-2 control-label">上级</label>
                <div class="col-md-8">
                     <c:choose>
                         <c:when test="${dic!=null}">
                             <input  value="${dic.text}" class="form-control input-large" disabled/>
                             <input id="parentId" name="parentId" value="${dic.id}" type="hidden"/>
                         </c:when>
                         <c:otherwise>
                             <input  value="----頂級----" class="form-control input-large" disabled/>
                             <input id="parentId" name="parentId" value="-1" type="hidden"/>
                         </c:otherwise>
                     </c:choose>

                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">标题</label>

                <div class="col-md-8">
                    <input id="text" name="text" value="${dictionary.text}" placeholder="${dic.text==null?dictionary.text:dic.text}"
                           class="form-control input-large"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">编码</label>

                <div class="col-md-8">
                    <input id="code" name="code" value="${dictionary.code}" placeholder="${dic.code==null?dictionary.code:dic.code}"
                           class="form-control input-large"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">状态</label>

                <div class="col-md-8">
                    <input name="status" value="1"  type="radio" <c:if test="${dictionary.status!=0}"> checked="checked" </c:if> class="ace"/>
                    <span class="lbl"> 启用</span>


                    <input name="status" value="0"  type="radio" <c:if test="${dictionary.status==0}"> checked="checked" </c:if> class="ace"/>
                    <span class="lbl"> 锁定</span>
                </div>
            </div>


            <div class="form-group">
                <label class="col-md-2 control-label">描述</label>

                <div class="col-md-8">
                    <textarea class="form-control" name="description" id="description" style="width:300px" style="text-align: left">${dictionary.description==null?dic.description:dictionary.description}</textarea>
                </div>
            </div>

        </form>
    </div>
</div>
<div id="editAlert1" class="hide" style="min-width:550px"></div>
</body>
</html>
